using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using IronSvn;

namespace IronSvn
{
   public class ExampleFull : Example
   {
      protected override void Finish(SvnClient client, string repo, string local)
      {
         SvnResult result;
         string repoDir = repo;
         if (!repoDir.EndsWith("/"))
         {
            repoDir += "/";
         }

         base.Finish(client, repo, local);

         // Create a local dir
         string dir = Path.Combine(local, @"testdir\");
         client.MakeDirectory(dir, "Created directory");

         // Commit the local dir
         client.Commit(local, "Added directory");

         // Create a remote directory
         client.MakeDirectory(repoDir + @"testdir2\", "Created directory remotely");

         client.Update(local);

         // Delete a local dir
         client.Delete(dir);

         // Commit the delete
         client.Commit(local, "Deleted directory");

         // Move test.txt to testdir2
         client.Move(Path.Combine(local, "test.txt"), Path.Combine(local, @"testdir2\test.txt"));

         Directory.CreateDirectory(Path.Combine(local, @"testdir2\testdir3\"));
         client.Add(Path.Combine(local, @"testdir2\testdir3\"));

         // Commit the move
         client.Commit(local, "Moved file");

         List<SvnEntry> entries = client.Ls(repo);

         SvnInfo info = client.Info(local);

         bool hasTarget = client.HasTarget(Path.Combine(local, @"testdir2\test.txt"));

         result = client.Add(Path.Combine(local, @"testdir2\*"));

         List<SvnNode> nodes = client.Changed(repo);

         SvnLookInfo i = client.GetAuthor(repo);

         i = client.GetInfo(repo);
      }
   }
}
